package sasp_KML;


public class Motion {
private float startlat = (float) 39.954096;
private float startlong = (float) -75.166397;
private float[] dest = new float[2];
private float m;
private float b;
private float steplong = startlong;
private float steplat = startlat;
private float inclong;
private float inclat;
//maximum latitude = 39.967319
//minimum latitude = 39.937711
//maximum longitude = -75.13979
//minimum longitude = -75.204849

public float[] GenDest(){
float randomlat = (float) (Math.random()*0.029608);
randomlat = (float) (randomlat  + 39.937711);
float randomlong = (float) (Math.random()*0.065059);
randomlong = (float) (randomlong + -75.204849);
dest[0] = randomlat;
dest[1] = randomlong;
if(dest[1] < startlong){
	inclong = (float) - 0.0001;
} else{
	inclong = (float) 0.0001;
}
m = (startlat - dest[0])/(startlong - dest[1]);
b = startlat - (m*startlong);
return dest;
}

public float getinc(){
	return inclong;
}


public double[] GenStep(){

steplong = (float) (steplong + inclong);
steplat = (float) (m*steplong +b);
try{
	Thread.sleep(500);
}catch(InterruptedException ex){
	ex.printStackTrace();
}

double[] step = new double[2];
step[0] = steplat;
step[1] = steplong;


return step;
}


}
